import formBuilder from "@/comps/form/formBuilder";
import api from "../../FileCategory/js/api";
import apiSeller from "../../Seller/js/api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)
        fb.addSearch("sellerId").setLabel("档案主体").setSpan(12)
            .setApi(apiSeller.urlChoice).setApiSearchKeys(["name__like","short__like"])

        fb.addText("name").setLabel("资料名称").setSpan(6)
            .setRules([fb.R.notNull("资料名称不能为空")])

        fb.addCascade("catId").setLabel("资料分类").setSpan(3)
            .setApi(api.urlTree)
            .setRules([fb.R.notNull("请选择资料分类")])

        fb.addText("sort").setSpan(3).setLabel("序号").setTypeNumber()

        fb.addArt("content").setSpan(12).setLabel("详情")

        fb.addFiles("assets").setSpan(12).setLabel("附件")
            .setIsFile().setAcceptAny().setIsMultiple()

        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}